﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Types;

namespace Client
{
    public partial class AddQuestionCourseListForm : Form
    {
        private string username { get; set; }
        private List<CourseType> courseList { get; set; }

        public AddQuestionCourseListForm(List<CourseType> courseList, string username)
        {
            InitializeComponent();
            this.username = username;
            this.courseList = courseList;
            foreach (var course in courseList)
            {
                coursesListBox.Items.Add(course.name);
            }
        }

        private void coursesListBox_MouseClick(object sender, MouseEventArgs e)
        {
            AddQuestionForm addQuestion = new AddQuestionForm(courseList[coursesListBox.SelectedIndex], username);
            addQuestion.ShowDialog();
            this.Close();
        }
    }
}
